﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.master" AutoEventWireup="true"
    CodeFile="EditContracts.aspx.cs" Inherits="Admin_EditContracts" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <table class="innerContent" width="100%" cellpadding="0" cellspacing="0">
        <tr>
            <td>
                <img src="Images/img-table-1.gif" />
            </td>
            <td width="100%" class="table-bg-1">
            </td>
            <td>
                <img src="Images/img-table-2.gif" />
            </td>
        </tr>
        <tr>
            <td class="table-bg-2">
                &nbsp;
            </td>
            <td>
                <div class="heading">
                    <img src="Images/img-heading-box.gif" align="absmiddle" />
                    &nbsp; Manage Contract</div>
                <div class="strip">
                </div>
                <br />
                <br />
                <table cellpadding="5" width="100%">
                    <tr>
                        <td colspan="2">
                            <asp:Label runat="server" ID="lblError" CssClass="failureNotification">
                            </asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            Contract Title*:
                        </td>
                        <td>
                            <asp:TextBox runat="server" ID="txtTitle" Width="230" MaxLength="50" CssClass="textboxcss"></asp:TextBox>
                            <asp:RequiredFieldValidator runat="server" ControlToValidate="txtTitle" Display="Dynamic"
                                ValidationGroup="EditContracts" ErrorMessage="Contract Title is required" CssClass="failureNotification">*</asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            Client Name*:
                        </td>
                        <td>
                            <asp:TextBox runat="server" ID="txtClientName" Width="230" MaxLength="50" CssClass="textboxcss"></asp:TextBox>
                            <asp:RequiredFieldValidator runat="server" ControlToValidate="txtClientName" Display="Dynamic"
                                ValidationGroup="EditContracts" ErrorMessage="Client Name is required" CssClass="failureNotification">*</asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            Contract Description*:
                        </td>
                        <td>
                            <asp:TextBox runat="server" Width="230" TextMode="MultiLine" Height="50" ID="txtContractDescription"
                                MaxLength="500" CssClass="textboxcss"></asp:TextBox>
                            <asp:RequiredFieldValidator runat="server" ControlToValidate="txtContractDescription"
                                ValidationGroup="EditContracts" Display="Dynamic" ErrorMessage="Contract Description is required"
                                CssClass="failureNotification">*</asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            Image*:
                        </td>
                        <td>
                            <asp:FileUpload ID="fileuploadImage" runat="server" />
                            <asp:RequiredFieldValidator ID="reqImageVal" runat="server" ControlToValidate="fileuploadImage" ValidationGroup="EditContracts"
                                Display="Dynamic" ValidationExpression="^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w].*))(.jpg|.JPG|.gif|.GIF)$"
                                ErrorMessage="Upload JPEG/GIF Files" CssClass="failureNotification">*</asp:RequiredFieldValidator>
                            <asp:RegularExpressionValidator ID="refImage" SetFocusOnError="True" runat="server" ControlToValidate="fileuploadImage" ValidationGroup="EditContracts"
                                ErrorMessage="Upload JPEG/GIF Files" ValidationExpression="^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w].*))(.jpg|.JPG|.gif|.GIF)$" CssClass="failureNotification"
                                Display="Dynamic"></asp:RegularExpressionValidator>

                        </td>
                    </tr>
                   
                    <tr>
                        <td>
                            &nbsp;
                        </td>
                        <td align="left">
                            <asp:Button runat="server" ID="btnSubmit" ValidationGroup="EditContracts" Text="Submit"
                                OnClick="btnSubmit_Click" />
                            <asp:Button runat="server" Visible="false" ID="btnUpdate" ValidationGroup="EditContracts"
                                Text="Update" OnClick="btnUpdate_Click" />
                            <asp:ValidationSummary runat="server" ValidationGroup="EditContracts" ShowMessageBox="true"
                                ShowSummary="false" />
                            <asp:HiddenField runat="server" ID="hidContractId" />
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <asp:GridView ID="grdContracts" HorizontalAlign="Center" CellPadding="5" runat="server"
                                AutoGenerateColumns="False" AllowPaging="true" PageSize="10" CssClass="grdv-style"
                                DataKeyNames="Id" EmptyDataText="Sorry! No Contract found." OnRowCommand="grdContracts_RowCommand"
                                OnRowDeleting="grdContracts_RowDeleting" OnRowUpdating="grdContracts_RowUpdating"
                                OnPageIndexChanging="grdContracts_PageIndexChanging">
                                <Columns>
                                    <asp:TemplateField HeaderText="Contract Title">
                                        <ItemTemplate>
                                            <asp:Label ID="lblTitle" Width="150px" runat="server" Text='<%#Eval("Title")%>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Description">
                                        <ItemTemplate>
                                            <asp:Label ID="lblDescription" Width="150px" runat="server" Text='<%#Eval("Description")%>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Image">
                                        <ItemTemplate>
                                            <asp:Label ID="lblImage" Width="150px" runat="server" Text='<%#Eval("Image")%>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Client Name">
                                        <ItemTemplate>
                                            <asp:Label ID="lblClientName" Width="150px" runat="server" Text='<%#Eval("ClientName")%>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Delete">
                                        <ItemTemplate>
                                            <asp:LinkButton ID="lnkDelete" runat="server" Text="Delete" CommandName="Delete"
                                                OnClientClick="return confirm('Are you sure to delete this product?');" CommandArgument='<%#Eval("Id")%>'></asp:LinkButton>
                                            <asp:LinkButton ID="lnkEdit" runat="server" Text="Edit" CommandName="Update" CommandArgument='<%#Eval("Id")%>'></asp:LinkButton>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <%--<asp:TemplateField HeaderText="Edit">
                            <ItemTemplate>
                                <asp:LinkButton ID="lnkEdit" Width="80px" runat="server" Text="Edit" CommandName="Update" CommandArgument='<%#Eval("ProductID")%>'></asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>--%>
                                </Columns>
                                <HeaderStyle CssClass="grdv-header-style" />
                                <RowStyle CssClass="grdv-row-style" />
                                <AlternatingRowStyle CssClass="grdv-altrow-style" />
                                <FooterStyle CssClass="grdv-footer-style" />
                                <PagerStyle CssClass="grdv-pager-style" />
                                <EmptyDataRowStyle CssClass="grdv-empty-style" />
                            </asp:GridView>
                        </td>
                    </tr>
                </table>
                <br />
                <br />
                <div class="cl">
                </div>
            </td>
            <td class="table-bg-3">
                &nbsp;
            </td>
        </tr>
        <tr>
            <td>
                <img src="Images/img-table-3.gif" />
            </td>
            <td class="table-bg-4">
            </td>
            <td>
                <img src="Images/img-table-4.gif" />
            </td>
        </tr>
    </table>
</asp:Content>
